#pragma once

class CBinarySearch
{
public:
	static int ExecBinarySearch(int num)
	{
		int Index = 0;
		int l = 0, r = num;
		int mid = (r - l) / 2;
		while (l < r)
		{
			mid = l + (r - l) / 2;
			if (mid * mid < num)
			{
				Index = mid;
				l = mid + 1;
			}
			else
			{
				r = mid - 1;
			}
		}
		return Index;
	}
};
